which does not exist with python2.2, causing the following build
error:
make[2]: Entering directory `/home/muli/xen/x86.hg/tools/pygrub'
CFLAGS=" -m32 -march=i686" python setup.py build
Traceback (most recent call last):
File "setup.py", line 15, in ?
if cc.has_function("ext2fs_open2"):
AttributeError: UnixCCompiler instance has no attribute 'has_function'
The following patch gets it to build, but is pretty ugly. A proper fix
would be to do the check for ext2fs_open2() in a way that is backward
compatible with python2.2.
Signed-Off-By: Muli Ben-Yehuda <mulix@mulix.org>
ext2defines = []
cc = new_compiler()
cc.add_library("ext2fs")
- if cc.has_function("ext2fs_open2"):
- ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
- else:
- sys.stderr.write("WARNING: older version of e2fsprogs installed, not building full\n")
- sys.stderr.write(" disk support for ext2.\n")
+ try:
+ if cc.has_function("ext2fs_open2"):
+ ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
+ else:
+ sys.stderr.write("WARNING: older version of e2fsprogs installed, not building full\n")
+ sys.stderr.write(" disk support for ext2.\n")
+ except AttributeError:
+ pass
ext2 = Extension("grub.fsys.ext2._pyext2",
extra_compile_args = extra_compile_args,